<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui">


<ui:composition template="/WEB-INF/templates/newsmaintemplate.xhtml">
	<ui:define name="navigation">
		<h:panelGroup>
			<f:event type="preRenderComponent" listener="#{navigationMapBackingBean.clearNavigationMapNewsCategory()}" />
			<ui:include src="/navigationNews.xhtml"></ui:include>
		</h:panelGroup>
	</ui:define>
	<ui:define name="leftpage">
		<!-- picture news -->
		<div>
			<h:form>
				<div class="rectacularPictureDiv">
					<h:commandLink onclick="switcher.previous();return false;">
						<img src="/resources/images/arrow-previous.gif" />
					</h:commandLink>
					<h:commandLink onclick="switcher.next();return false;">
						<img src="/resources/images/arrow-next.gif" />
					</h:commandLink>
					<p:imageSwitch effect="fade" widgetVar="switcher" slideshowAuto="true" slideshowSpeed="3000">
						<ui:repeat value="#{newsDashBoardCacheService.pictureNewsList}" var="picNewsDashBoard">
							<h:panelGrid columns="1">
								<h:link outcome="viewnews">
									<p:graphicImage url="#{picNewsDashBoard.picturePathURL}" styleClass="rectacularPicture"></p:graphicImage>
									<f:param name="id" value="#{picNewsDashBoard.newsId}"></f:param>
								</h:link>
								<h:link outcome="viewnews" styleClass="longstyle" value="#{picNewsDashBoard.newsSubject}">
									<f:param name="id" value="#{picNewsDashBoard.newsId}"></f:param>
								</h:link>
							</h:panelGrid>
						</ui:repeat>
					</p:imageSwitch>
				</div>
				<div class="rectacularPictureDiv-Second">
					<p:dataList value="#{newsDashBoardCacheService.pictureNewsList}" var="picNewsDashBoard" type="none" itemType="disc" rows="10"
						styleClass="picnewsrightpart">
						<li><h:link outcome="viewnews" styleClass="longstyle" value="#{picNewsDashBoard.newsSubject}">
								<f:param name="id" value="#{picNewsDashBoard.newsId}"></f:param>
							</h:link></li>
					</p:dataList>
				</div>
			</h:form>
		</div>
		<div class="solidThickLine"></div>

		<div>
			<h:form id="regularNewsForm">
				<!-- display Tab news  -->
				<p:tabView value="#{newsDashBoardCacheService.tabNewsCategoryNameRegList}" var="newsCategoryName">
					<p:tab title="#{newsCategoryName}">
						<p:dataList value="#{newsDashBoardCacheService.getNonPicTabNewsDB(newsCategoryName)}" var="newsDB" type="none" effectSpeed="slow">
							<li class="thumb">
								<div class="content">
									<div class="readFloor_comment_right">
										<h:panelGroup styleClass="thumbnail" rendered="#{! empty newsDB.picturePathURL}">
											<h:link outcome="viewnews" styleClass="longstyle">
												<f:param name="id" value="#{newsDB.newsId}"></f:param>
												<p:graphicImage value="#{newsDB.picturePathURL}" width="100px" height="75px"></p:graphicImage>
											</h:link>
										</h:panelGroup>
										<h:panelGroup styleClass="txt" layout="block">
											<h:link value="#{newsDB.newsSubject}" outcome="viewnews" styleClass="title">
												<f:param name="id" value="#{newsDB.newsId}"></f:param>
											</h:link>
											<p>
												<h:outputText value="#{newsDB.newsDescription}" />
											</p>
										</h:panelGroup>
									</div>
								</div>
							</li>
						</p:dataList>
						<div class="more">
							<h:link value="#{msgs.MoreButton} #{newsCategoryName}" outcome="listnews">
								<f:param name="ctgtNewsId" value="#{newsDB.newsCategoryId}"></f:param>
							</h:link>
						</div>
					</p:tab>
				</p:tabView>

				<!-- ad -->
				<ui:include src="/ad/leaderboard.xhtml"></ui:include>

				<!-- display regular news  -->

				<ui:repeat value="#{newsDashBoardCacheService.regularNewsCategoryNameRegList}" var="categoryName">
					<div class="solidThickLine"></div>
					<h:link value="#{categoryName}»" outcome="listnews" styleClass="sectionTitle">
						<f:param name="ctgtNewsId" value="#{newsDashBoardCacheService.getNonPicRegularNewsDB(categoryName).get(0).newsCategoryId}"></f:param>
					</h:link>
					<p:dataList value="#{newsDashBoardCacheService.getNonPicRegularNewsDB(categoryName)}" var="newsDB" type="none" effectSpeed="slow"
						styleClass="regularNewsCategoryOnIndex">
						<li class="thumb">
							<div class="content">
								<div class="readFloor_comment_right">
									<h:panelGroup styleClass="thumbnail" rendered="#{! empty newsDB.picturePathURL}">
										<h:link outcome="viewnews" styleClass="longstyle">
											<f:param name="id" value="#{newsDB.newsId}"></f:param>
											<img src="#{newsDB.picturePathURL}" width="100px" height="75px" />
										</h:link>
									</h:panelGroup>
									<h:panelGroup styleClass="txt" layout="block">
										<h:link value="#{newsDB.newsSubject}" outcome="viewnews" styleClass="title">
											<f:param name="id" value="#{newsDB.newsId}"></f:param>
										</h:link>
										<p>
											<h:outputText value="#{newsDB.newsDescription}" />
										</p>
									</h:panelGroup>
								</div>
							</div>
						</li>
					</p:dataList>
				</ui:repeat>
			</h:form>
		</div>
	</ui:define>
	<ui:define name="rightpage">
		<h:form>
			<p:dataList value="#{newsCacheEjb.recentOverAllNews}" var="news" itemType="disc">
				<f:facet name="header">#{msgs.NEWSFORYOU}</f:facet>
				<h:link value="#{news.subject}" outcome="viewnews" styleClass="longstyle">
					<f:param name="id" value="#{news.id}"></f:param>
				</h:link>
			</p:dataList>
		</h:form>
	</ui:define>

</ui:composition>

</html>